package relu.fbs.xt;

/** Row, column section etc identifying a single datum in FBS datasets after 2000 */
public class FBSPost2000DataPoint {
	public final int farmId;
	public final char section;
	public final int row;
	public final int col;
	public final int ctype;
	public final int err;

	FBSPost2000DataPoint(int fi,char sec,int rw,int cl,int ct,int ec){
		farmId=fi;section=sec;row=rw;col=cl;ctype=ct;err=ec;
	}
	
	public boolean[] match(FBSPost2000DataPoint other){
		boolean[] status=new boolean[6];
		status[0]=(farmId==other.farmId);
		status[1]=(section==other.section);
		status[2]=(row==other.row);
		status[3]=(col==other.col);
		status[4]=(ctype==other.ctype);
		status[5]=(err==other.err);
		return status;
	}
	
	public boolean equals(Object other){
		if ( this == other ){ return true;};
		if ( other instanceof FBSPost2000DataPoint){
			FBSPost2000DataPoint oth=(FBSPost2000DataPoint)other;
			if ( oth.hashCode() == hashCode()){
				return true;
			} 
		}
		return false;
	}
	public int hashCode(){
		int hash=7;
		hash=31*hash+farmId;
		hash=31*hash+section;
		hash=31*hash+row;
		hash=31*hash+col;
		hash=31*hash+ctype;
		hash=31*hash+err;
		return hash;
	}
	
}
